<% @page_title = "多背一公斤 | 社区" -%>

<% content_for :sidebar do -%>
<div class="prepend-1">
  <h3 class="nt">全部板块 <%= title_suffix %></h3>
  <div style="padding-left:20px;">
  <% @boards.each do |b| -%>
    <h4><%= link_to b.title, group_url(b) %></h4>
  <% end -%>
  </div>
</div>
<% end -%>

<h3 class="nt">最新话题 <%= title_suffix %></h3>

  <% @topics.each do |topic| -%>
    <div class="otopic span-15">
      <div class="span-7"><%= link_to h(topic.title), topic_url(topic.group, topic), :class => 'title' %></div>
      <div class="span-6"><span class="meta"><%= link_to topic.user.login, user_url(topic.user) %> <%= calc_time_to_now topic.created_at %> 写于 <%= link_to "[#{topic.group.title}]", group_url(topic.group) %></span></div>
      <div class="span-2 last"><span class="meta"><%= topic.posts_count > 0 ? "#{topic.posts_count}条回复" : "没有回复" %></span></div>
      
    </div>
  <% end -%>
